﻿using System.Web.Mvc;
using WebPic.Sample.Comum;

namespace WebPic.Sample.Aplicacao.Models {
    public class ModelStateWrapper : IValidationDictionary {

        private readonly ModelStateDictionary _modelState;

        public ModelStateWrapper(ModelStateDictionary modelState) {
            _modelState = modelState;
        }

        public void AddError(string key, string errorMessage) {
            _modelState.AddModelError(key, errorMessage);
        }

        public bool IsValid {
            get { return _modelState.IsValid; }
        }
    }
}